<?php

class IniReader
{
    private $m_config;
    public function __construct() 
    {
        $this->m_config = parse_ini_file( dirname(__FILE__). '/../bedminton.ini' );
    }

    public function iniValue( $parameter, & $value )
    {
        if (! $this->m_config ||
            ! array_key_exists( $parameter, $this->m_config ))
        {
            logError( "Unable to read ini value for the parameter $parameter" );
            return false;
            
        }
        
        if (! array_key_exists( $parameter, $this->m_config ))
            return false;
            
        $value = $this->m_config[ $parameter ];
        return true;
    }
}

?>
